package com.jingyanzi.privilege.domain.result;

import java.io.Serializable;
import java.util.Map;

public interface ResultDO extends Serializable {
	
	String FIRST_MODEL_KEY = "first_model";
	String SECOND_MODEL_KEY = "second_model";
	String THIRD_MODEL_KEY = "third_model";
	
	Integer SYSTEM_EXCEPTION_ERROR = 1000;

	Integer BTN_ADD_ERROR = 1001;
	Integer BTN_EDIT_ERROR = 1002;
	Integer BTN_QUERY_ERROR = 1003;
	Integer BTN_DELETE_ERROR = 1004;
	
	Integer EMPLOYEE_ADD_ERROR = 2001;
	Integer EMPLOYEE_EDIT_ERROR = 2002;
	Integer EMPLOYEE_QUERY_ERROR = 2003;
	Integer EMPLOYEE_DELETE_ERROR = 2004;
	
	Integer MENU_ADD_ERROR = 3001;
	Integer MENU_EDIT_ERROR = 3002;
	Integer MENU_QUERY_ERROR = 3003;
	Integer MENU_DELETE_ERROR = 3004;
	
	Integer JOB_ADD_ERROR = 4001;
	Integer JOB_EDIT_ERROR = 4002;
	Integer JOB_QUERY_ERROR = 4003;
	Integer JOB_DELETE_ERROR = 4004;
	
	Integer ROLE_ADD_ERROR = 5001;
	Integer ROLE_EDIT_ERROR = 5002;
	Integer ROLE_QUERY_ERROR = 5003;
	Integer ROLE_DELETE_ERROR = 5004;
	
	Integer FIELD_ADD_ERROR = 6001;
	Integer FIELD_EDIT_ERROR = 6002;
	Integer FIELD_QUERY_ERROR = 6003;
	Integer FIELD_DELETE_ERROR = 6004;
	
	Integer TABLE_ADD_ERROR = 7001;
	Integer TABLE_EDIT_ERROR = 7002;
	Integer TABLE_QUERY_ERROR = 7003;
	Integer TABLE_DELETE_ERROR = 7004;
	
	Integer USER_ADD_ERROR = 7001;
	Integer USER_EDIT_ERROR = 7002;
	Integer USER_QUERY_ERROR = 7003;
	Integer USER_DELETE_ERROR = 7004;
	
	Integer ORG_ADD_ERROR = 8001;
	Integer ORG_EDIT_ERROR = 8002;
	Integer ORG_QUERY_ERROR = 8003;
	Integer ORG_DELETE_ERROR = 8004;

	/**
	 * 设置请求成功标志。
	 * 
	 * @param success
	 *            成功标志
	 */
	void setSuccess(boolean success);

	/**
	 * 请求是否成功。
	 * 
	 * @return 如果成功，则返回<code>true</code>
	 */
	boolean isSuccess();

	/**
	 * 获取返回码
	 * 
	 * @return 返回码
	 */
	Integer getErrorCode();

	/**
	 * 设置返回码
	 * 
	 * @param code
	 */
	void setErrorCode(Integer code);

	String getErrorMsg();

	void setErrorMsg(String msg);

	/**
	 * 返回子的返回码
	 * 
	 * @return
	 */
	String getErrorSubCode();

	/**
	 * 设置子返回码
	 * 
	 * @param code
	 */
	void setErrorSubCode(String code);

	String getErrorSubMsg();

	void setErrorSubMsg(String msg);

	/**
	 * 取得model对象
	 * 
	 * @param key
	 *            字符串key
	 * @return model对象
	 */
	Object getModel(String key);

	/**
	 * 设置model对象。
	 * 
	 * @param key
	 *            字符串key
	 * @param model
	 *            model对象
	 */
	void setModel(String key, Object model);

	/**
	 * 取得所有model对象。
	 * 
	 * @return model对象表
	 */
	Map<String, Object> getModels();

}
